package com.csii.activiti.server.abstraction.constant;

import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
public enum MessageType {


    /**
     * 待办时
     */
    todo("todo", "待办时"),

    /**
     * 审批完成时
     */
    done("done", "审批完成时"),

    /**
     * 抄送时
     */
    copy("copy", "抄送时"),

    /**
     * 驳回时
     */
    reject("reject", "驳回时"),

    /**
     * 抄送时
     */
    transfer("transfer", "抄送时 "),

    /**
     * 撤回时
     */
    withdrawn("withdrawn", "撤回时"),

    /**
     * 催办系统提醒时
     */
    urgingSystem("urgingSystem", "催办系统提醒"),
    /**
     * 催办钉钉提醒时
     */
    urgingDingTalk("urgingDingTalk", "催办钉钉提醒"),
    /**
     * 催办短信提醒时
     */
    urgingSms("urgingSms", "催办短信提醒"),
    /**
     * 催办邮件提醒时
     */
    urgingEmail("urgingEmail", "催办邮件提醒"),
    ;



    private String type;
    private String description;

    public static MessageType byType(String description){
        for (MessageType value : values()) {
            if (value.type.equals(description)) {
                return value;
            }
        }
        return null;
    }

}
